﻿using House.Server.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace House.Server.WebApi.ViewModel
{
    public class DictionaryViewModel
    {
        /// <summary>
        /// 显示所有字典信息
        /// </summary>
        public static dynamic DicticonarySelect()
        {
            /// <summary>
            /// 调用字典BLL中所有方法
            /// </summary>
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.Select();
        }

        /// <summary>
        /// 删除字典
        /// </summary>
        public static dynamic DictionaryDelete(int id)
        {
            /// <summary>
            /// 调用字典BLL中所有方法
            /// </summary>
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.DeleteById(id);
        }

        /// <summary>
        /// 添加字典
        /// </summary>
        /// <returns></returns>
        public static dynamic DictionaryAdd(Dictionary list)
        {
            /// <summary>
            /// 调用字典BLL中所有方法
            /// </summary>
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.Insert(list);
        }

        /// <summary>
        /// 显示字典(根据Id查询)
        /// </summary>
        /// <returns></returns>
        public static dynamic DictionarySelect1(int id)
        {
            /// <summary>
            /// 调用字典BLL中所有方法
            /// </summary>
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.Select(P=>P.Dmenuid == id);
        }

        /// <summary>
        /// 修改信息字典
        /// </summary>
        /// <returns></returns>
        public static dynamic DictionaryUpdate(Dictionary list)
        {
            /// <summary>
            /// 调用字典BLL中所有方法
            /// </summary>
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.Update(list);
        }

        /// <summary>
        /// 字典链接显示
        /// </summary>
        /// <returns></returns>
        public static dynamic link_show()
        {
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.link_show();
        }

        /// <summary>
        /// 字典Dmenuid查询显示
        /// </summary>
        /// <returns></returns>
        public static dynamic inquire_show(int id)
        {
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.inquire_show(id);
        }

        /// <summary>
        /// 字典Did查询显示
        /// </summary>
        /// <returns></returns>
        public static dynamic single_show(int id)
        {
            Service.System_DictionaryService Dictionary = new Service.System_DictionaryService();
            return Dictionary.single_show(id);
        }
    }
}